<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="cache-control" content="no-cache">
    <meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
    <link href=//at.alicdn.com/t/font_893333_1vgxt517n6z.css rel=stylesheet>
    <style>
      .bgy-screen-video{
        background-image: url("/static/images/bgy-bg.jpg");
        background-size: 100%;
        width: 100%;
        height: 100%;
      }
      .bgy-login-bg{
        background-image: url("/static/images/bgy-login-bg.jpg");
        background-size: 100%;
      }
      .bgy-project-bg{
        background-image: url("/static/images/projectLogin-2.jpg");
        background-size: 100%;
      }
    </style>
  </head>
  <body class="bgy-login-bg">
  <!--[if lt IE 10]>
  <div class="v-ie9">
    <p>碧桂园智慧工地暂不支持ie9及以下版本</p>
    <p>
      <span>请使用</span>
      <a href="http://rj.baidu.com/soft/detail/11843.html" target="_blank">ie10以上浏览器</a>，如果是360，QQ等国产浏览器请切换到兼容模式</p>
  </div>
  <![endif]-->
    <div id="app"></div>
  </body>
  <script language="javascript" for="mpv" event="MPV_FireWndSelected(lWndId, cameraUuid)">
    if(cameraUuid === '') return
    function GetCameryRequest () {
      var strs = null
      var url = location.href
      var theRequest = {}
      if (url.indexOf('?') !== -1) {
        var str = url.substr(1)
        var str1 = str.split('?')
        strs = str1[1].split('&')
        for (let i = 0; i < strs.length; i++) {
          theRequest[strs[i].split('=')[0]] = decodeURIComponent(strs[i].split('=')[1])
        }
      }
      return theRequest
    }
    var cameraHKType = 1
    var cameraHKId = 1
    var requestQuery = GetCameryRequest()
    var cameraQuery = {
      cameraId: cameraUuid,
      name: requestQuery.name
    }
    if (requestQuery.departmentId) {
      cameraHKType = 'departmentId'
      cameraHKId = requestQuery.departmentId
    } else {
      cameraHKType = 'pjId'
      cameraHKId = requestQuery.pjId
    }
    cameraQuery[cameraHKType] = cameraHKId
    if (window.SPJKVIDEO.$local.get('login') === 'login') {
      window.SPJKVIDEO.$router.push({name: 'videoControl', query: cameraQuery})
    } else if (window.SPJKVIDEO.$local.get('login') === 'projectLogin') {
      window.SPJKVIDEO.$router.push({name: 'screenVideoControl', query: cameraQuery})
    } else if (window.SPJKVIDEO.$local.get('login') === 'loginCompany') {
      window.SPJKVIDEO.$router.push({name: 'companyVideoControl', query: cameraQuery})
    }

  </script>
  <script>
    window.onbeforeunload = function () {
      if (document.getElementById('mpv')) {
        var ocxObj = document.getElementById('mpv')
        ocxObj.MPV_Uninit()
      }
      if (document.getElementById('spv')) {
        var ocxSingerObj = document.getElementById('spv')
        ocxSingerObj.MPV_Uninit()
      }
    }
  </script>
  <script language="javascript" for="mpv" event="MPV_FirePreviewResult(lWndId, lPreviewResult)">
    var _item = window.SPJKVIDEO.deviceVideoList
    var _nameItem = window.SPJKVIDEO.projectNameArray
    var _nameObj = window.SPJKVIDEO.projectNameObject
    if (lPreviewResult === 1) {
      if (window.SPJKVIDEO.$router.history.current.name === 'videoProject') {
        if (_item[lWndId]) {
          window.SPJKVIDEO.SetOSD(_item[lWndId].cameraUuid, _nameObj, _item[lWndId].departmentName)
        }
      } else {
        if (_item[lWndId]) {
          window.SPJKVIDEO.SetOSD(_item[lWndId].cameraUuid, _nameItem[lWndId].projectTitle, _item[lWndId].departmentName)
        }
      }
    }
  </script>
  <script language="javascript" for="spv" event="MPV_FirePreviewResult(lWndId, lPreviewResult)">
    window.SINGOCXVIEDEO.SetSpvOSD()
  </script>
</html>
